<?php
include 'includes.php';

$pj1 = R::findOne('pjs', 'usuario_id = :id' ,[':id' =>$_SESSION['user']['id']]);

if(isset($_SESSION['user']) && $pj1->id == $_GET['id'] ) {
    $nick = $_POST['nick'];
    $clase = $_POST['clase'];
    $rol = $_POST['rol'];
    
$pj = R::load('pjs', $_GET['id']);
$pj->nick = $nick;
$pj->clase = $clase;
$pj->rol = $rol;

R::store($pj);


    
}



error_reporting(E_ALL);
$host3 = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'pj.php';
header("Location: http://" . $host3 . $uri . "/" . $extra);
die();
?>
